#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<string.h>
void reverse(char* left, char* right)
{
	while (left < right)
	{
		char tmp = *left;
		*left = *right;
		*right = tmp;
		left++;
		right--;
	}
}
int main()
{
	char ch[20] = "ABCD";
	int n = 0;
	int len = strlen(ch)-1;
	scanf("%d", &n);
	reverse(ch, ch+n-1);
	reverse(ch + n, ch + len);
	reverse(ch, ch + len);
	printf("%s\n", ch);
	return 0;
}